import {BaseEntity,Column,Entity,Index,JoinColumn,JoinTable,ManyToMany,ManyToOne,OneToMany,OneToOne,PrimaryColumn,PrimaryGeneratedColumn,RelationId} from "typeorm";


@Entity("sys_region",{schema:"nest-mall" } )
@Index("agency_id",["agencyId",])
@Index("parent_id",["parentId",])
@Index("region_type",["type",])
export class SysRegion {

    @PrimaryGeneratedColumn({
        type:"mediumint", 
        name:"id"
        })
    id:number;
        

    @Column("mediumint",{ 
        nullable:false,
        default: () => "'0'",
        name:"parent_id"
        })
    parentId:number;
        

    @Column("varchar",{ 
        nullable:false,
        length:120,
        name:"name"
        })
    name:string;
        

    @Column("tinyint",{ 
        nullable:false,
        width:1,
        default: () => "'2'",
        name:"type"
        })
    type:boolean;
        

    @Column("int",{ 
        nullable:false,
        default: () => "'0'",
        name:"agency_id"
        })
    agencyId:number;
        
}
